<?php
	namespace Api\Controller;
	use Think\Controller;
	header("Content-Type:text/html;charset=utf-8");
	class FeedbackController extends Controller
	{
		//意见反馈
		public function adviceFeedback($uid=null, $token=null, $content=null)
		{
			$result = M("User") -> where("uid={$uid}") -> find();
			/* if ($result['token'] != $token) 
			{
				$array['result'] = -2;
				$array['message'] = "token过期或错误，请重新登录获取";
				echo json_encode($array, JSON_UNESCAPED_SLASHES);
				exit;
			} */
			$data = $_POST;
			$result = M("Feedback") -> where("uid={$uid}") -> find();
			$data = array(
					'content'=>$content,
					'uid'=>$uid
			);
			$result = M("Feedback") -> data($data) -> add();
			if ($result > 0) 
			{
				$array['result'] = 0;
				$array['message'] = "意见反馈成功";
				echo json_encode($array, JSON_UNESCAPED_SLASHES);
				exit;
			}
			else
			{
				$array['result'] = -1;
				$array['message'] = "意见反馈失败";
				echo json_encode($array, JSON_UNESCAPED_SLASHES);
				exit;
			}
		}
	}